3.1.14 \(\int \frac {\csc ^3(x)}{a \cos (x)+b \sin (x)} \, dx\) [14]

Optimal. Leaf size=55 \[ \frac {b \cot (x)}{a^2}-\frac {\csc ^2(x)}{2 a}+\frac {\left (a^2+b^2\right ) \log (\sin (x))}{a^3}-\frac {\left (a^2+b^2\right ) \log (a \cos (x)+b \sin (x))}{a^3} \]

[Out]

b*cot(x)/a^2-1/2*csc(x)^2/a+(a^2+b^2)*ln(sin(x))/a^3-(a^2+b^2)*ln(a*cos(x)+b*sin(x))/a^3

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {3182, 3852, 8, 3180, 3556, 3212} \begin {gather*} \frac {b \cot (x)}{a^2}+\frac {\left (a^2+b^2\right ) \log (\sin (x))}{a^3}-\frac {\left (a^2+b^2\right ) \log (a \cos (x)+b \sin (x))}{a^3}-\frac {\csc ^2(x)}{2 a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[x]^3/(a*Cos[x] + b*Sin[x]),x]

[Out]

(b*Cot[x])/a^2 - Csc[x]^2/(2*a) + ((a^2 + b^2)*Log[Sin[x]])/a^3 - ((a^2 + b^2)*Log[a*Cos[x] + b*Sin[x]])/a^3

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3180

Int[1/(sin[(c_.) + (d_.)*(x_)]*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])), x_Symbol] :>
Dist[1/a, Int[Cot[c + d*x], x], x] - Dist[1/a, Int[(b*Cos[c + d*x] - a*Sin[c + d*x])/(a*Cos[c + d*x] + b*Sin[c
 + d*x]), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]

Rule 3182

Int[sin[(c_.) + (d_.)*(x_)]^(m_)/(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)]), x_Symbol] :>
 Simp[Sin[c + d*x]^(m + 1)/(a*d*(m + 1)), x] + (-Dist[b/a^2, Int[Sin[c + d*x]^(m + 1), x], x] + Dist[(a^2 + b^
2)/a^2, Int[Sin[c + d*x]^(m + 2)/(a*Cos[c + d*x] + b*Sin[c + d*x]), x], x]) /; FreeQ[{a, b, c, d}, x] && NeQ[a
^2 + b^2, 0] && LtQ[m, -1]

Rule 3212

Int[((A_.) + cos[(d_.) + (e_.)*(x_)]*(B_.) + (C_.)*sin[(d_.) + (e_.)*(x_)])/((a_.) + cos[(d_.) + (e_.)*(x_)]*(
b_.) + (c_.)*sin[(d_.) + (e_.)*(x_)]), x_Symbol] :> Simp[(b*B + c*C)*(x/(b^2 + c^2)), x] + Simp[(c*B - b*C)*(L
og[a + b*Cos[d + e*x] + c*Sin[d + e*x]]/(e*(b^2 + c^2))), x] /; FreeQ[{a, b, c, d, e, A, B, C}, x] && NeQ[b^2
+ c^2, 0] && EqQ[A*(b^2 + c^2) - a*(b*B + c*C), 0]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

\begin {align*} \int \frac {\csc ^3(x)}{a \cos (x)+b \sin (x)} \, dx &=-\frac {\csc ^2(x)}{2 a}-\frac {b \int \csc ^2(x) \, dx}{a^2}+\frac {\left (a^2+b^2\right ) \int \frac {\csc (x)}{a \cos (x)+b \sin (x)} \, dx}{a^2}\\ &=-\frac {\csc ^2(x)}{2 a}+\frac {b \text {Subst}(\int 1 \, dx,x,\cot (x))}{a^2}+\frac {\left (a^2+b^2\right ) \int \cot (x) \, dx}{a^3}-\frac {\left (a^2+b^2\right ) \int \frac {b \cos (x)-a \sin (x)}{a \cos (x)+b \sin (x)} \, dx}{a^3}\\ &=\frac {b \cot (x)}{a^2}-\frac {\csc ^2(x)}{2 a}+\frac {\left (a^2+b^2\right ) \log (\sin (x))}{a^3}-\frac {\left (a^2+b^2\right ) \log (a \cos (x)+b \sin (x))}{a^3}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.17, size = 48, normalized size = 0.87 \begin {gather*} \frac {2 a b \cot (x)-a^2 \csc ^2(x)+2 \left (a^2+b^2\right ) (\log (\sin (x))-\log (a \cos (x)+b \sin (x)))}{2 a^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]^3/(a*Cos[x] + b*Sin[x]),x]

[Out]

(2*a*b*Cot[x] - a^2*Csc[x]^2 + 2*(a^2 + b^2)*(Log[Sin[x]] - Log[a*Cos[x] + b*Sin[x]]))/(2*a^3)

________________________________________________________________________________________

Maple [A]
time = 0.12, size = 53, normalized size = 0.96

method result size
default \(-\frac {1}{2 a \tan \left (x \right )^{2}}+\frac {\left (a^{2}+b^{2}\right ) \ln \left (\tan \left (x \right )\right )}{a^{3}}+\frac {b}{a^{2} \tan \left (x \right )}-\frac {\left (a^{2}+b^{2}\right ) \ln \left (a +b \tan \left (x \right )\right )}{a^{3}}\) \(53\)
norman \(\frac {-\frac {1}{8 a}-\frac {\tan ^{4}\left (\frac {x}{2}\right )}{8 a}+\frac {b \tan \left (\frac {x}{2}\right )}{2 a^{2}}-\frac {b \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{2 a^{2}}}{\tan \left (\frac {x}{2}\right )^{2}}+\frac {\left (a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {x}{2}\right )\right )}{a^{3}}-\frac {\left (a^{2}+b^{2}\right ) \ln \left (a \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-2 b \tan \left (\frac {x}{2}\right )-a \right )}{a^{3}}\) \(96\)
risch \(\frac {2 i \left (-i a \,{\mathrm e}^{2 i x}+b \,{\mathrm e}^{2 i x}-b \right )}{\left ({\mathrm e}^{2 i x}-1\right )^{2} a^{2}}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {i b +a}{i b -a}\right )}{a}-\frac {\ln \left ({\mathrm e}^{2 i x}-\frac {i b +a}{i b -a}\right ) b^{2}}{a^{3}}+\frac {\ln \left ({\mathrm e}^{2 i x}-1\right )}{a}+\frac {\ln \left ({\mathrm e}^{2 i x}-1\right ) b^{2}}{a^{3}}\) \(127\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)^3/(a*cos(x)+b*sin(x)),x,method=_RETURNVERBOSE)

[Out]

-1/2/a/tan(x)^2+(a^2+b^2)/a^3*ln(tan(x))+b/a^2/tan(x)-(a^2+b^2)/a^3*ln(a+b*tan(x))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 119 vs. \(2 (53) = 106\).
time = 0.28, size = 119, normalized size = 2.16 \begin {gather*} -\frac {\frac {4 \, b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}}{8 \, a^{2}} - \frac {{\left (a^{2} + b^{2}\right )} \log \left (-a - \frac {2 \, b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac {a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}{a^{3}} + \frac {{\left (a^{2} + b^{2}\right )} \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a^{3}} - \frac {{\left (a - \frac {4 \, b \sin \left (x\right )}{\cos \left (x\right ) + 1}\right )} {\left (\cos \left (x\right ) + 1\right )}^{2}}{8 \, a^{2} \sin \left (x\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)^3/(a*cos(x)+b*sin(x)),x, algorithm="maxima")

[Out]

-1/8*(4*b*sin(x)/(cos(x) + 1) + a*sin(x)^2/(cos(x) + 1)^2)/a^2 - (a^2 + b^2)*log(-a - 2*b*sin(x)/(cos(x) + 1)
+ a*sin(x)^2/(cos(x) + 1)^2)/a^3 + (a^2 + b^2)*log(sin(x)/(cos(x) + 1))/a^3 - 1/8*(a - 4*b*sin(x)/(cos(x) + 1)
)*(cos(x) + 1)^2/(a^2*sin(x)^2)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 117 vs. \(2 (53) = 106\).
time = 1.66, size = 117, normalized size = 2.13 \begin {gather*} -\frac {2 \, a b \cos \left (x\right ) \sin \left (x\right ) - a^{2} + {\left ({\left (a^{2} + b^{2}\right )} \cos \left (x\right )^{2} - a^{2} - b^{2}\right )} \log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + b^{2}\right ) - {\left ({\left (a^{2} + b^{2}\right )} \cos \left (x\right )^{2} - a^{2} - b^{2}\right )} \log \left (-\frac {1}{4} \, \cos \left (x\right )^{2} + \frac {1}{4}\right )}{2 \, {\left (a^{3} \cos \left (x\right )^{2} - a^{3}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)^3/(a*cos(x)+b*sin(x)),x, algorithm="fricas")

[Out]

-1/2*(2*a*b*cos(x)*sin(x) - a^2 + ((a^2 + b^2)*cos(x)^2 - a^2 - b^2)*log(2*a*b*cos(x)*sin(x) + (a^2 - b^2)*cos
(x)^2 + b^2) - ((a^2 + b^2)*cos(x)^2 - a^2 - b^2)*log(-1/4*cos(x)^2 + 1/4))/(a^3*cos(x)^2 - a^3)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc ^{3}{\left (x \right )}}{a \cos {\left (x \right )} + b \sin {\left (x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)**3/(a*cos(x)+b*sin(x)),x)

[Out]

Integral(csc(x)**3/(a*cos(x) + b*sin(x)), x)

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 78, normalized size = 1.42 \begin {gather*} \frac {{\left (a^{2} + b^{2}\right )} \log \left ({\left | \tan \left (x\right ) \right |}\right )}{a^{3}} - \frac {{\left (a^{2} b + b^{3}\right )} \log \left ({\left | b \tan \left (x\right ) + a \right |}\right )}{a^{3} b} - \frac {3 \, a^{2} \tan \left (x\right )^{2} + 3 \, b^{2} \tan \left (x\right )^{2} - 2 \, a b \tan \left (x\right ) + a^{2}}{2 \, a^{3} \tan \left (x\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)^3/(a*cos(x)+b*sin(x)),x, algorithm="giac")

[Out]

(a^2 + b^2)*log(abs(tan(x)))/a^3 - (a^2*b + b^3)*log(abs(b*tan(x) + a))/(a^3*b) - 1/2*(3*a^2*tan(x)^2 + 3*b^2*
tan(x)^2 - 2*a*b*tan(x) + a^2)/(a^3*tan(x)^2)

________________________________________________________________________________________

Mupad [B]
time = 0.57, size = 91, normalized size = 1.65 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )\,\left (a^2+b^2\right )}{a^3}-\frac {\ln \left (-a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {x}{2}\right )+a\right )\,\left (a^2+b^2\right )}{a^3}-\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{8\,a}-\frac {b\,\mathrm {tan}\left (\frac {x}{2}\right )}{2\,a^2}-\frac {\frac {a}{2}-2\,b\,\mathrm {tan}\left (\frac {x}{2}\right )}{4\,a^2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(x)^3*(a*cos(x) + b*sin(x))),x)

[Out]

(log(tan(x/2))*(a^2 + b^2))/a^3 - (log(a + 2*b*tan(x/2) - a*tan(x/2)^2)*(a^2 + b^2))/a^3 - tan(x/2)^2/(8*a) -
(b*tan(x/2))/(2*a^2) - (a/2 - 2*b*tan(x/2))/(4*a^2*tan(x/2)^2)

________________________________________________________________________________________